package server;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Scontrol {




    public static void main(String args[]){
        //
        //创建执行环境
        //注意辨别：Connection, Statement等应当来自java.sql.*
        Connection myconn= Sjdbc.getMyjd().getConn();
        Statement stm = null;
        try {
            stm = myconn.createStatement();
            ResultSet rst = stm.executeQuery("select * from student0");
            for(;rst.next();){
                System.out.println(
                        rst.getInt("stuId")+" "+rst.getString("stuname"));
            }
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
